package com.baseframe.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baseframe.datasources.DataSourceNames;
import com.baseframe.datasources.annotation.DataSource;
import com.baseframe.sys.entity.FrameUser;
import com.baseframe.sys.service.IFrameUserService;

/**
 * 测试多数据源
 *
 */
@Service
public class DataSourceTestService {
    @Autowired
    private IFrameUserService sysUserService;

    public FrameUser queryUser(String userId){
        return sysUserService.selectById(userId);
    }

    @DataSource(name = DataSourceNames.SECOND)
    public FrameUser queryUser2(String userId){
        return sysUserService.selectById(userId);
    }
}
